/*
 *	Copyright (C) 2008 - Mauricio Bieze Stefani
 *	This file is part of the Insano Game Engine.
 *
 *	Insano is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	Insano is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with Insano.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef ANIMATION_H
#define ANIMATION_H

#include <irrlicht.h>
#include <map>

class Animation
{
	public:
		enum Actions
		{
			STAND,
			WALK,
			RUN,
			ATTACK,
			PAIN_A,
			PAIN_B,
			PAIN_C,
			JUMP,
			FLIP,
			SALUTE,
			FALLBACK,
			WAVE,
			POINT,
			CROUCH_STAND,
			CROUCH_WALK,
			CROUCH_ATTACK,
			CROUCH_PAIN,
			CROUCH_DEATH,
			DEATH_FALLBACK,
			DEATH_FALLFORWARD,
			DEATH_FALLBACKSLOW,
			BOOM
		};
		virtual ~Animation() {}
		virtual void setAction(irr::scene::IAnimatedMeshSceneNode* node, Actions newAction) = 0;
	protected:
	private:
};

class AnimationMD2 : public Animation
{
	public:
		AnimationMD2();
		virtual void setAction(irr::scene::IAnimatedMeshSceneNode* node, Actions newAction);
	private:
		std::map<Actions, irr::scene::EMD2_ANIMATION_TYPE> actions;
};

class AnimationFrame : public Animation
{
	public:
		virtual void setAction(irr::scene::IAnimatedMeshSceneNode* node, Actions newAction);
		void addAction(Actions action, irr::s32 startFrame, irr::s32 endFrame);
	private:
		std::map<Actions, irr::core::vector2di> actions;
};

#endif // ANIMATION_H
